/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Rodrigo
 */
@Embeddable
public class BairroPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id")
    private int id;
    @Basic(optional = false)
    @Column(name = "fk_municipio")
    private int fkMunicipio;

    public BairroPK() {
    }

    public BairroPK(int id, int fkMunicipio) {
        this.id = id;
        this.fkMunicipio = fkMunicipio;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getFkMunicipio() {
        return fkMunicipio;
    }

    public void setFkMunicipio(int fkMunicipio) {
        this.fkMunicipio = fkMunicipio;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) id;
        hash += (int) fkMunicipio;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BairroPK)) {
            return false;
        }
        BairroPK other = (BairroPK) object;
        if (this.id != other.id) {
            return false;
        }
        if (this.fkMunicipio != other.fkMunicipio) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.entidades.BairroPK[ id=" + id + ", fkMunicipio=" + fkMunicipio + " ]";
    }
    
}
